# !/usr/bin/env python3
"""
input format:


text1

----


text2
(text3)
text4(text5)

---
text5

output format:

text2 
text4(text5)

"""
from sys import argv
if __name__=="__main__":
    with open(argv[1]) as reader:
        print(f"{__file__}: Reading from {argv[1]}")
        lines = reader.readlines()
    lines = [line 
             for line in lines 
             if line[0]!='('
                and line[0]!='（'
             ]
    enter_main=False 
    with open(argv[2],'w') as writer:
        print(f"{__file__}: Writing to {argv[2]}")
        number=0
        for line in lines:
            new_line = line
            # new_line+='\n'
            if len(line.split(".")) == 3:
                number=0
                writer.write(new_line)
                continue
            # space_split = new_line.split(" ")
            # if len(space_split) > 1 and len(space_split[0]) < 3:
            #     number += 1
            #     new_line =f"{number}. {new_line}"
                # if len(new_line.split("**"))>=3:
                    
            # if line.strip() == '----':
            #     enter_main = True
            #     continue
            # if line.strip() == '---':
            #     enter_main = False
            #     continue
            # if not enter_main:
            #     continue
            # if line.strip() == '':
            #     continue
            # if line[0] == ' ':
            #     continue
            # if line[0] == '\n':
            #     continue
            writer.write(new_line)